package com.zzyl.controller.customer;

import cn.hutool.db.PageResult;
import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/customer/orders/project")
public class CustomerOrderController {
    @Autowired
    NursingProjectService nursingProjectService;
    @GetMapping("/page")
    public ResponseResult<PageResponse<NursingProjectVo>> page(String name, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, Integer status){
        PageResponse<NursingProjectVo> page = nursingProjectService.getByPage(name, pageNum, pageSize, status);
        return ResponseResult.success(page);
    }
    @GetMapping("/{id}")
    public ResponseResult getById(@PathVariable Long id){
        NursingProjectVo nursingProjectVo = nursingProjectService.getById(id);
        return ResponseResult.success(nursingProjectVo);
    }
}
